<script src ="scripts/carPooling.js"></script>
<script src ="scripts/httpService.js"></script>

<div class="pageheader">
    <h2><i class="fa fa-hand-o-up"></i> 拼车拼玩 </h2>
</div>

<div class="contentpanel" ng-app="carPoolingApp" ng-controller="carPoolingCtrl">
    <div class="row xg-content">
        <div class="col-xs-12">
            <div class="btn-group">
                <button type="button" class="btn btn-warning" ng-click="refresh()"><span class="glyphicon glyphicon-refresh"></span> 刷新</button>
                <button ng-show="false" type="button" class="btn btn-primary" ng-click="addNotice()"><span class="glyphicon glyphicon-pencil"></span> 添加消息</button>
                <button ng-show="false" hidden type="button" class="btn btn-success" ng-click="updateNotice()"><span class="glyphicon glyphicon-send"></span> 更新消息</button>
                <button type="button" class="btn btn-danger" ng-click="deleteNotice()"><span class="glyphicon glyphicon-trash"></span> 删除消息</button>
            </div>
            <table class="table table-striped table-hover">
                <tr>
                    <th>选择</th>
                    <th>id</th>
                    <th>类别</th>
                    <th>内容</th>
                    <th>作者</th>
                    <th>截至日期</th>
                    <th>发布日期</th>
                </tr>
                <tr ng-repeat="notice in notices" ng-click="selectChange($index)">
                    <td><input type="checkbox" ng-model="notice.checked" /> </td>
                    <td ng-bind="notice.id"></td>
                    <td ng-bind="notice.description"></td>
                    <td ng-bind="notice.content"></td>
                    <td ng-bind="notice.name"></td>
                    <td ng-bind="notice.expireDate"></td>
                    <td ng-bind="notice.date"></td>
                </tr>

            </table>
        </div>
    </div>

    <script type="text/ng-template" id="modifyNotice">
        <div class='modal-content'  >
            <div class='modal-header'>
                <button type='button' class='close' data-dismiss='modal' ng-click="close()" >&times;</button>
                <h2 class='modal-title' style="padding-left:40%" id='addParkLabel'>通知</h2>
            </div>

            <div class='modal-body '>
                <form class='form-horizontal' role='form'>
                    <div class="panel panel-info">
                        <div class="panel-heading">
                            <h3 class="panel-title">
                                通知消息
                            </h3>
                        </div>
                        <div class="panel-body">
                            <div class='form-group '>
                                <div class="col-sm-2 ">
                                    <label class='control-label' style="float:right" >内容</label>
                                </div>
                                <div class='col-sm-10'>
                                    <textarea rows='5' class="form-control" ng-model="notice.content"></textarea>
                                    </select>
                                </div>
                            </div>

                            <div class='form-group '>
                                <div class="col-sm-2 ">
                                    <label class='control-label' style="float:right">作者</label>
                                </div>
                                <div class='col-sm-10'>
                                    <input type="text" class='form-control date' ng-model="notice.owner" placeholder='填写作者信息'/>
                                </div>
                            </div>

                            <div class='form-group '>
                                <div class="col-sm-2 ">
                                    <label class='control-label' style="float:right">备注</label>
                                </div>
                                <div class='col-sm-10'>
                                    <input type="text" class='form-control date' ng-model="notice.other" placeholder='填写备注信息'/>
                                </div>
                            </div>

                        </div>
                    </div>

                    <div class="alert alert-info" ng-show="loading || submitted">
                        <span  ng-show='loading' > <i class="fa fa-spinner"></i></span>
                        <span ng-show='submitted'>{{result}}</span>
                    </div>

                    <div class='modal-footer'>
                        <button type='button' class='btn btn-default' id="modalCloseBtn" data-dismiss='modal' ng-click="close()">关闭</button>
                        <button id="submitParkBtn" type='button'ng-click="submit()" class='btn btn-primary'>提交</button>
                    </div>

            </div>
    </script>
</div><!-- contentpanel -->
</div><!-- mainpanel -->

<script src="js/xg_js.js"></script>
<script>
    createMenu(12);
</script>
